<%= form_for(@user) do |f| %>
  <% if @user.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2>

      <ul>
      <% @user.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= f.label :name %><br />
    <%= text_field :user, :name %>
  </div>
  <div class="field">
    <%= f.label :login %><br />
    <%= text_field :user, :login %>
  </div>
  <div class="field">
    <%= f.label :password %><br />
    <%= password_field :user, :password %>
  </div>
  <div class="field">
    <%= f.label :password %><br />
    <%= password_field :user, :password_confirmation %>
  </div>
<% if @user.type == nil  %>  
  <div class="field">
    <%= label :user, :type %><br />
    <% options = {"Administrador" => "Administrator", "Professor" => "Teacher", "Aluno" => "Student"}%>
    <%= select(:user, :type, options, :prompt => ">> Choose <<") %>
  </div>
<% end %>
  <div class="actions">
      <%= f.submit %>
  </div>
<% end %>
